﻿<%@ Page Language="C#" MasterPageFile="~/CmsMaster.Master" AutoEventWireup="true" CodeBehind="ListClient.aspx.cs" Inherits="ContractManagementSystem.Presentation.ProfileManagement.ListClient" Title="Profile Manager >>> List client" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link rel = "Stylesheet" type = "text/css" href = "../../Styles/ClientStyle.css" />
    
    <script type = "text/javascript" language = "javascript" src = "../../JavaScript/jquery.js"> </script>
    <script type = "text/javascript" language = "javascript" src = "../../JavaScript/menu.js"> </script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentHolder" runat="server">
    <div class="CPF">

        <div class="CPFSearch">
            <div class="CPFclientleft">
                <asp:Label runat="server">FullName:</asp:Label>
            </div>
            <div class="CPFclientright">
                <asp:TextBox runat="server" ID="textFullName" CssClass="CPFTextBox"></asp:TextBox>
            </div>
            <div class="CPFclientleft">
                <asp:Label ID="Label1" runat="server">Company Name:</asp:Label>
            </div>
            <div class="CPFclientright">
                <asp:TextBox runat="server" ID="textCompanyName" CssClass="CPFTextBox"></asp:TextBox>
            </div>
            <div class="CPFButtonSearch">
                <asp:Button runat="server" ID="ButtonSearch" Text="Search" 
                            CssClass="CPFButton1" onclick="ButtonSearchClick"/>
            </div>
        </div>
        
        <div style="font-size: 14px; margin: 15px;">
            <asp:Label runat="server" ID="labelResult" CssClass="CPFResultsMessage"></asp:Label>
        </div>
        
        <asp:ScriptManager runat="server" ID="test"></asp:ScriptManager>
      
        <div class="CPFGrid">

            <asp:ListView ID="ListViewClient" runat="server" 
                          OnItemCommand = "ListViewClientItemCommand" 
                          onitemdeleting="ListViewClientItemDeleting">
                <LayoutTemplate>
                    <table class="repeaterTable" >
                        <tr class="tableHeader" >
                            <td></td>
                            <td>UserName</td>
                            <td >FullName</td>        
                            <td >Company Name</td>
                            <td >Address</td>
                            <td >Phone Number</td>
                            <td >Email</td>
                            <td >Option</td>
                        </tr>
                        <tr id="itemPlaceholder" runat="server"></tr>
                    </table>
                    
                    <table class="CPFrepeaterTable" >
                        <tr class="CPFtableHeader">
                        
                            <td>
                                <asp:LinkButton ID="linkDelSelected" ForeColor="Blue" runat="server" CssClass="CPFDeletePage" 
                                                OnClientClick='javascript:return confirm("Are you sure you want to delete?")'  
                                                CommandArgument='<%#Eval("ClientId")%>' onclick="LinkDelSelectedClick">Delete Selected
                                                
                                </asp:LinkButton>                      
                            </td>    
                                                
                            <td class="CPFPage">
                                <asp:DataPager runat="server" ID="ItemDataPager" PagedControlID="ListViewClient" PageSize="10">
                                    <Fields>
                                        <asp:NextPreviousPagerField ShowFirstPageButton="true" ShowNextPageButton="false" ButtonCssClass="CPFNumPage" />
                                        <asp:NumericPagerField ButtonCount="5" NumericButtonCssClass="CPFNumPage" CurrentPageLabelCssClass="CPFCurrentNumPage" />
                                        <asp:NextPreviousPagerField ShowLastPageButton="true" ShowPreviousPageButton="false" ButtonCssClass="CPFNumPage"/>
                                    </Fields>                    
                                </asp:DataPager>                      
                            </td>                                
  
                        </tr>
                    </table>

                </LayoutTemplate>
                <ItemTemplate>
                    <tr class="CPFTr">
                        <td>
                            <input type="checkbox" runat="server" id="checkDelete" value='<%#Eval("ClientId")%>' />
                        </td>
                    
                       
                        <td class="CPFtd">
                            <asp:Label runat="server" ID="LabelUserName" Width="50"><%#Eval("UserName")%></asp:Label>
                        </td>
                    
                        <td class="CPFtd" >
                            <a href="ViewClientDetail.aspx?id=<%#Eval("ClientId")%>"><asp:Label ID="labelFullName" runat="server"><%#DataBinder.Eval(Container.DataItem, "FullName")%></asp:Label></a>
                        </td>
                    
                        <td class="CPFtd companyname">
                            <asp:Label ID="labelCompanyName" runat="server"><%#DataBinder.Eval(Container.DataItem, "CompanyName")%></asp:Label>
                        </td>
                    
                        <td class="CPFtd">
                            <asp:Label ID="labelAddress" runat="server"><%#DataBinder.Eval(Container.DataItem, "Address")%></asp:Label>
                        </td>
                    
                        <td class="CPFtd">
                            <asp:Label ID="labelPhoneNumber" runat="server"><%#DataBinder.Eval(Container.DataItem, "PhoneNumber")%></asp:Label>
                        </td>
                    
                        <td class="CPFtd">
                            <asp:Label ID="labelEmail" runat="server"><%#DataBinder.Eval(Container.DataItem, "Email")%></asp:Label>
                        </td>
                    
                        <td class="CPFtd">
                    
                            <asp:LinkButton runat="server" OnClientClick='javascript:return confirm("Are you sure you want to delete?")' CommandName="Delete" CommandArgument='<%#Eval("ClientId")%>'>
                                <asp:Image ID="Image1" runat="server" CssClass="CPFdelete" ImageUrl="../../Images/CPFdelete.png"></asp:Image>                       
                            </asp:LinkButton>
                        
                            <a href="UpdateClient.aspx?id=<%#Eval("ClientId")%>">
                                <asp:Image ID="Image2" runat="server" CssClass="CPFdelete" ImageUrl="../../Images/CPFedit.png"></asp:Image>
                            </a>
                        
                        </td>
                    </tr>   
                             
                </ItemTemplate>  
                <EmptyItemTemplate>
                    <tr>
                        <label style="text-align: center; color: #FF0000; font-size: 18px;">Not data</label>
                    </tr>                    
                </EmptyItemTemplate>
                <EmptyDataTemplate>
                    <table class="repeaterTable" >
                        <tr class="tableHeader" >
                            <td>UserName</td>
                            <td>FullName</td>        
                            <td>Company Name</td>
                            <td>Address</td>
                            <td>Phone Number</td>
                            <td>Email</td>
                            <td>Option</td>
                        </tr>
                        <tr>
                            <td colspan="8" class="CPFNotData">
                                <label style="color: #FF0000; font-size: 18px;">Sorry ! no data found</label>
                            </td>                            
                        </tr>                         
                    </table>

                </EmptyDataTemplate>         
            </asp:ListView>
        </div>      


      
    </div> 
    
</asp:Content>